#include "DxfReader.h"
#include "DxfRenderModel.h"
#include "EntityCreation.h"
#include "dl_dxf.h"
#include <QString>
#include <QFile>
#include <memory>


DxfRenderModel* DxfReader::read( const QString& filePath )
{
	if(!QFile::exists(filePath)) return new DxfRenderModel();

	std::shared_ptr<EntityCreation> creation(new EntityCreation());
	std::shared_ptr<DL_Dxf> dxf(new DL_Dxf());
	dxf->in(filePath.toStdString().c_str(), creation.get());
	creation->finish();

	return  creation->getDxfRenderModel();


}
